<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>订单管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="{{ url_for('static',filename='layuiadmin/layui/css/layui.css') }}" media="all">
    <link rel="stylesheet" href="{{ url_for('static',filename='layuiadmin/style/admin.css') }}" media="all">

</head>

<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form" style="padding-bottom: 10px">
                        <div class="layui-input-inline">
                            <input type="text" name="user_id" autocomplete="off"
                                   placeholder="用户手机号" class="layui-input">
                            <input type="hidden" name="status" value="{{ 3 }}" class="layui-input">
                        </div>

                        <div class="layui-input-inline " style="width: 90px">
                            <button class="layui-btn" id="searchEmailCompany" data-type="reload">
                                <i class="layui-icon" style="font-size: 20px; "></i> 搜索
                            </button>
                        </div>
                    </form>

                    <table class="layui-hide" id="test-table" lay-filter="test-table"></table>
                    <script type="text/html" id="test-table-barDemo">
                        <a class="layui-btn layui-btn-xs layui-btn-normal"
                           lay-href="/cms/mall/mall_orders_detail/?order_id={{ '{{ d.order_id }}' | safe }}">订单详情</a>
                    </script>

                </div>
            </div>
        </div>
    </div>

</div>

<!-- 展示图片大小 -->
<style type="text/css">
    .layui-table-cell {
        text-align: center;
        height: auto;
        white-space: normal;
    }

    .layui-table img {
        max-width: 100px
    }
</style>


<!-- 添加和修改的弹出层开始 -->
<div style="display: none;padding: 20px" id="saveOrUpdateDiv">
    <form class="layui-form " action="" lay-filter="dataFrm" id="dataFrm">


        <div class="layui-form-item">
            <div class="layui-col-md10">
                <label class="layui-form-label">快递公司：</label>
                <div class="layui-input-block">
                    <select name="data_id" id="data_id" lay-filter="data_id">
                        <option value=""></option>
                        {% for j in delivery %}
                            <option value="{{ j.id }}">{{ j.name }}</option>
                        {% endfor %}

                    </select>
                </div>
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-col-md10">
                <label class="layui-form-label">快递单号：</label>
                <div class="layui-input-block">
                    <input type="text" name="logistics_num" placeholder="请输入快递单号" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
        </div>


        <input type="hidden" name="order_id" id="order_id">
        <input type="hidden" name="status" value="{{ status }}">
        <input type="hidden" name="user_id_" value="{{ user_id or '' }}">

        <div class="layui-form-item" style="margin-top:40px; ">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="doSubmit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>


    </form>
</div>
<!-- 添加和修改的弹出层结束 -->


<script src="{{ url_for('static',filename='layuiadmin/layui/layui.js') }}"></script>
<script>
    layui.config({
        base: '../../../static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table', 'jquery', 'layer', 'form', 'upload'], function () {
        var admin = layui.admin;
        var table = layui.table;
        var upload = layui.upload;
        var $ = layui.jquery;
        var data_status = $("input[name='status']").val();
        var data_user_id = $("input[name='user_id_']").val();

        var tableIns = table.render({
            elem: '#test-table',
            title: '已发货订单',
            toolbar: true,
            url: '/cms/mall/buy_deal_deliver_info/?status=1' + '&user_id=' + data_user_id,
            cols: [[
                {field: 'order_id', title: 'ID', align: 'center', hide: true,},
                {field: 'phone', title: '账号', align: 'center'},
                {field: 'num', title: '总数量', align: 'center'},
                {field: 'total_price', title: '总金额', align: 'center'},
                {field: 'create_time', title: '创建时间', align: 'center'},
                {field: 'update_time', title: '发货时间', align: 'center'},
                {field: 'logistics_name', title: '快递公司', align: 'center'},
                {field: 'logistics_num', title: '快递单号', align: 'center'},
                {#{field: 'trade_no', title: '订单号', align: 'center'},#}
                {#{field: 'status', title: '状态', align: 'center'},#}
                {#{align: 'center', title: '操作', toolbar: '#test-table-barDemo',}#}
            ]]
            , page: true
        });

    });
</script>
</body>
</html>